package org.shilong.Utility;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

public class GenerateTime {
	
	private GenerateTime(){}

	private static Calendar CAL;
	private static SimpleDateFormat formatter;
	private static String result = "";

	static{
		CAL = Calendar.getInstance(Locale.CHINA);

		formatter  = new   SimpleDateFormat( "yyyy-MM-dd",Locale.CHINA);
	}

	/**
	 * @return
	 */
	public static String getCurrentTime(){

		CAL.setTimeInMillis( System.currentTimeMillis() ); 

		CAL.add(Calendar.DAY_OF_MONTH,0);

		result= formatter.format(CAL.getTime());

		return result;

	}


	/**
	 * @return
	 */
	public static String getOneYearEndTime(){

		CAL.setTimeInMillis( System.currentTimeMillis() );

		CAL.add(Calendar.DAY_OF_MONTH,365);

		result= formatter.format(CAL.getTime());

		return result;
	}
	/**
	 * @return
	 */
	public static String getEndTime(){

		CAL.setTimeInMillis( System.currentTimeMillis() );

		CAL.add(Calendar.DAY_OF_MONTH,92);

		result= formatter.format(CAL.getTime());

		return result;
	}


	/**
	 * @return
	 */
	public static String getTempAccountEndTime(){

		CAL.setTimeInMillis( System.currentTimeMillis() );

		CAL.add(Calendar.DAY_OF_MONTH,1);

		result= formatter.format(CAL.getTime());

		return result;

	}
}
